package com.zycfc.zsf.boot.mq.common;

import org.springframework.boot.context.properties.*;

@ConfigurationProperties(prefix = "zsf.boot.mq")
public class MQProperties
{
    public static final String PREFIX = "zsf.boot.mq";
    private boolean enabled;
    private String address;
    private String secretId;
    private String secretKey;
    private int retryTimesWhenSendFailed;
    private int requestTimeoutMS;
    private String host;
    private int port;
    private boolean errNotifyEnabled;
    private String errNotifyUrl;
    private boolean initSqlFlag;
    
    public MQProperties() {
        this.enabled = true;
        this.retryTimesWhenSendFailed = 0;
        this.requestTimeoutMS = 3000;
        this.host = "localhost";
        this.port = 5672;
        this.errNotifyEnabled = true;
        this.initSqlFlag = true;
    }
    
    public boolean isEnabled() {
        return this.enabled;
    }
    
    public String getAddress() {
        return this.address;
    }
    
    public String getSecretId() {
        return this.secretId;
    }
    
    public String getSecretKey() {
        return this.secretKey;
    }
    
    public int getRetryTimesWhenSendFailed() {
        return this.retryTimesWhenSendFailed;
    }
    
    public int getRequestTimeoutMS() {
        return this.requestTimeoutMS;
    }
    
    public String getHost() {
        return this.host;
    }
    
    public int getPort() {
        return this.port;
    }
    
    public boolean isErrNotifyEnabled() {
        return this.errNotifyEnabled;
    }
    
    public String getErrNotifyUrl() {
        return this.errNotifyUrl;
    }
    
    public boolean isInitSqlFlag() {
        return this.initSqlFlag;
    }
    
    public void setEnabled(final boolean enabled) {
        this.enabled = enabled;
    }
    
    public void setAddress(final String address) {
        this.address = address;
    }
    
    public void setSecretId(final String secretId) {
        this.secretId = secretId;
    }
    
    public void setSecretKey(final String secretKey) {
        this.secretKey = secretKey;
    }
    
    public void setRetryTimesWhenSendFailed(final int retryTimesWhenSendFailed) {
        this.retryTimesWhenSendFailed = retryTimesWhenSendFailed;
    }
    
    public void setRequestTimeoutMS(final int requestTimeoutMS) {
        this.requestTimeoutMS = requestTimeoutMS;
    }
    
    public void setHost(final String host) {
        this.host = host;
    }
    
    public void setPort(final int port) {
        this.port = port;
    }
    
    public void setErrNotifyEnabled(final boolean errNotifyEnabled) {
        this.errNotifyEnabled = errNotifyEnabled;
    }
    
    public void setErrNotifyUrl(final String errNotifyUrl) {
        this.errNotifyUrl = errNotifyUrl;
    }
    
    public void setInitSqlFlag(final boolean initSqlFlag) {
        this.initSqlFlag = initSqlFlag;
    }
    
    @Override
    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof MQProperties)) {
            return false;
        }
        final MQProperties other = (MQProperties)o;
        if (!other.canEqual(this)) {
            return false;
        }
        if (this.isEnabled() != other.isEnabled()) {
            return false;
        }
        final Object this$address = this.getAddress();
        final Object other$address = other.getAddress();
        Label_0078: {
            if (this$address == null) {
                if (other$address == null) {
                    break Label_0078;
                }
            }
            else if (this$address.equals(other$address)) {
                break Label_0078;
            }
            return false;
        }
        final Object this$secretId = this.getSecretId();
        final Object other$secretId = other.getSecretId();
        Label_0115: {
            if (this$secretId == null) {
                if (other$secretId == null) {
                    break Label_0115;
                }
            }
            else if (this$secretId.equals(other$secretId)) {
                break Label_0115;
            }
            return false;
        }
        final Object this$secretKey = this.getSecretKey();
        final Object other$secretKey = other.getSecretKey();
        Label_0152: {
            if (this$secretKey == null) {
                if (other$secretKey == null) {
                    break Label_0152;
                }
            }
            else if (this$secretKey.equals(other$secretKey)) {
                break Label_0152;
            }
            return false;
        }
        if (this.getRetryTimesWhenSendFailed() != other.getRetryTimesWhenSendFailed()) {
            return false;
        }
        if (this.getRequestTimeoutMS() != other.getRequestTimeoutMS()) {
            return false;
        }
        final Object this$host = this.getHost();
        final Object other$host = other.getHost();
        Label_0215: {
            if (this$host == null) {
                if (other$host == null) {
                    break Label_0215;
                }
            }
            else if (this$host.equals(other$host)) {
                break Label_0215;
            }
            return false;
        }
        if (this.getPort() != other.getPort()) {
            return false;
        }
        if (this.isErrNotifyEnabled() != other.isErrNotifyEnabled()) {
            return false;
        }
        final Object this$errNotifyUrl = this.getErrNotifyUrl();
        final Object other$errNotifyUrl = other.getErrNotifyUrl();
        if (this$errNotifyUrl == null) {
            if (other$errNotifyUrl == null) {
                return this.isInitSqlFlag() == other.isInitSqlFlag();
            }
        }
        else if (this$errNotifyUrl.equals(other$errNotifyUrl)) {
            return this.isInitSqlFlag() == other.isInitSqlFlag();
        }
        return false;
    }
    
    protected boolean canEqual(final Object other) {
        return other instanceof MQProperties;
    }
    
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * 59 + (this.isEnabled() ? 79 : 97);
        final Object $address = this.getAddress();
        result = result * 59 + (($address == null) ? 43 : $address.hashCode());
        final Object $secretId = this.getSecretId();
        result = result * 59 + (($secretId == null) ? 43 : $secretId.hashCode());
        final Object $secretKey = this.getSecretKey();
        result = result * 59 + (($secretKey == null) ? 43 : $secretKey.hashCode());
        result = result * 59 + this.getRetryTimesWhenSendFailed();
        result = result * 59 + this.getRequestTimeoutMS();
        final Object $host = this.getHost();
        result = result * 59 + (($host == null) ? 43 : $host.hashCode());
        result = result * 59 + this.getPort();
        result = result * 59 + (this.isErrNotifyEnabled() ? 79 : 97);
        final Object $errNotifyUrl = this.getErrNotifyUrl();
        result = result * 59 + (($errNotifyUrl == null) ? 43 : $errNotifyUrl.hashCode());
        result = result * 59 + (this.isInitSqlFlag() ? 79 : 97);
        return result;
    }
    
    @Override
    public String toString() {
        return "MQProperties(enabled=" + this.isEnabled() + ", address=" + this.getAddress() + ", secretId=" + this.getSecretId() + ", secretKey=" + this.getSecretKey() + ", retryTimesWhenSendFailed=" + this.getRetryTimesWhenSendFailed() + ", requestTimeoutMS=" + this.getRequestTimeoutMS() + ", host=" + this.getHost() + ", port=" + this.getPort() + ", errNotifyEnabled=" + this.isErrNotifyEnabled() + ", errNotifyUrl=" + this.getErrNotifyUrl() + ", initSqlFlag=" + this.isInitSqlFlag() + ")";
    }
}
